import java.util.Date;
import org.apache.log4j.Logger;
public class WriteLog {
    private static Logger logger = Logger.getLogger(WriteLog.class);
    public static void main(String[] args) throws InterruptedException {
        // 记录debug级别的信息
        logger.debug("This is debug message.");
        // 记录info级别的信息  
        logger.info("This is info message.");
        // 记录error级别的信息  
        logger.error("This is error message.");
        int i = 0;
        while (true) {
            logger.info(new Date().getTime());
            logger.info("测试数据" + i);
            Thread.sleep(20);
            i += 1;
        }
    }
}